LL COMP Constants

Comparator modes - Power mode

group COMP_LL_EC_POWER_MODE

Defines

LL_COMP_POWER_MODE_HIGH_SPEED (0x00000000UL)

Comparator power mode to high speed

LL_COMP_POWER_MODE_MEDIUM_SPEED (COMP_CFGR1_PWRMODE_0)

Comparator power mode to medium speed

LL_COMP_POWER_MODE_ULTRA_LOW_POWER

(COMP_CFGR1_PWRMODE_1 \

| COMP_CFGR1_PWRMODE_0)


Comparator power mode to ultra-low power

Comparator modes - Power mode legacy definitions

group COMP_LL_EC_POWER_MODE_LEGACY

Defines

LL_COMP_POWERMODE_HIGHSPEED LL_COMP_POWER_MODE_HIGH_SPEED
LL_COMP_POWERMODE_MEDIUMSPEED LL_COMP_POWER_MODE_MEDIUM_SPEED
LL_COMP_POWERMODE_ULTRALOWPOWER LL_COMP_POWER_MODE_ULTRA_LOW_POWER

Comparator inputs - Input plus (input non-inverting) selection

group COMP_LL_EC_INPUT_PLUS

Defines

LL_COMP_INPUT_PLUS_IO1 (0x00000000UL)

Comparator input plus connected to IO1 (for GPIO mapping, refer to the datasheet parameters “COMPx_INP1”).

LL_COMP_INPUT_PLUS_IO2 (COMP_CFGR1_INPSEL_0)

Comparator input plus connected to IO2 (for GPIO mapping, refer to the datasheet parameters “COMPx_INP2”).

LL_COMP_INPUT_PLUS_IO3 (COMP_CFGR1_INPSEL_1)

Comparator input plus connected to IO3 (for GPIO mapping, refer to the datasheet parameters “COMPx_INP3”).

LL_COMP_INPUT_PLUS_DAC1_CH1 (COMP_CFGR1_INPSEL_1 | COMP_CFGR1_INPSEL_0)

Comparator input plus connected to DAC1 channel 1. Specific to COMP instance: COMP1.

Comparator inputs - Input minus (input inverting) selection

group COMP_LL_EC_INPUT_MINUS

Defines

LL_COMP_INPUT_MINUS_VREFINT

(COMP_CFGR1_INMSEL_1 | COMP_CFGR1_INMSEL_0 \

| COMP_CFGR1_SCALEN)


Comparator input minus connected to VrefInt (for VrefInt voltage value, refer to the datasheet).

LL_COMP_INPUT_MINUS_1_4VREFINT (COMP_CFGR1_SCALEN | COMP_CFGR1_BRGEN)

Comparator input minus connected to 1/4 VrefInt (for VrefInt voltage value, refer to the datasheet).

LL_COMP_INPUT_MINUS_1_2VREFINT (COMP_CFGR1_INMSEL_0 | COMP_CFGR1_SCALEN | COMP_CFGR1_BRGEN)

Comparator input minus connected to 1/2 VrefInt (for VrefInt voltage value, refer to the datasheet).

LL_COMP_INPUT_MINUS_3_4VREFINT (COMP_CFGR1_INMSEL_1 | COMP_CFGR1_SCALEN | COMP_CFGR1_BRGEN)

Comparator input minus connected to 3/4 VrefInt (for VrefInt voltage value, refer to the datasheet).

LL_COMP_INPUT_MINUS_IO1 (COMP_CFGR1_INMSEL_2 | COMP_CFGR1_INMSEL_0)

Comparator input minus connected to IO1 (for GPIO mapping, refer to the datasheet parameters “COMPx_INM1”).

LL_COMP_INPUT_MINUS_IO2 (COMP_CFGR1_INMSEL_2 | COMP_CFGR1_INMSEL_1)

Comparator input minus connected to IO2 (for GPIO mapping, refer to the datasheet parameters “COMPx_INM2”).

LL_COMP_INPUT_MINUS_IO3

(COMP_CFGR1_INMSEL_2 | COMP_CFGR1_INMSEL_1 \

| COMP_CFGR1_INMSEL_0)


Comparator input minus connected to IO3 (for GPIO mapping, refer to the datasheet parameters “COMPx_INM3”).

LL_COMP_INPUT_MINUS_DAC1_CH1 (COMP_CFGR1_INMSEL_2)

Comparator input minus connected to DAC1 channel 1. Specific to COMP instances: COMP1.

LL_COMP_INPUT_MINUS_TEMPSENSOR (COMP_CFGR1_INMSEL_3)

Comparator input minus connected to the internal temperature sensor (also accessible through the ADC peripheral). Call function LL_COMP_EnableInputTempSensorBuffer().

Comparator input - Hysteresis

group COMP_LL_EC_INPUT_HYSTERESIS

Defines

LL_COMP_HYSTERESIS_NONE (0x00000000UL)

No hysteresis

LL_COMP_HYSTERESIS_LOW (COMP_CFGR1_HYST_0)

Hysteresis level low

LL_COMP_HYSTERESIS_MEDIUM (COMP_CFGR1_HYST_1)

Hysteresis level medium

LL_COMP_HYSTERESIS_HIGH (COMP_CFGR1_HYST_1 | COMP_CFGR1_HYST_0)

Hysteresis level high

Comparator output - Output polarity

group COMP_LL_EC_OUTPUT_POLARITY

Defines

LL_COMP_OUTPUTPOL_NONINVERTED (0x00000000UL)

Comparator output polarity not inverted: comparator output at high level when input voltages: plus higher than minus

LL_COMP_OUTPUTPOL_INVERTED (COMP_CFGR1_POLARITY)

Comparator output polarity not inverted: comparator output at low level when input voltages: plus higher than minus

Comparator output - Blanking source

group COMP_LL_EC_OUTPUT_BLANKING_SOURCE

Defines

LL_COMP_BLANKINGSRC_NONE (0x00000000UL)

Comparator output without blanking

LL_COMP_BLANKINGSRC_TIM1_OC5 (COMP_CFGR1_BLANKING_0)

Comparator output blanking source TIM1 OC5, specific to instance: COMP1.

LL_COMP_BLANKINGSRC_TIM1_OC6 (COMP_CFGR1_BLANKING_0)

Comparator output blanking source TIM1 OC6, specific to instance: COMP2.

LL_COMP_BLANKINGSRC_TIM2_OC3 (COMP_CFGR1_BLANKING_1)

Comparator output blanking source TIM2 OC3.

LL_COMP_BLANKINGSRC_TIM5_OC3

(COMP_CFGR1_BLANKING_0 \

| COMP_CFGR1_BLANKING_1)


Comparator output blanking source TIM5 OC3.

LL_COMP_BLANKINGSRC_TIM5_OC4 (COMP_CFGR1_BLANKING_2)

Comparator output blanking source TIM5 OC4.

LL_COMP_BLANKINGSRC_TIM8_OC5

(COMP_CFGR1_BLANKING_2 \

| COMP_CFGR1_BLANKING_0)


Comparator output blanking source TIM8 OC5.

LL_COMP_BLANKINGSRC_TIM15_OC2

(COMP_CFGR1_BLANKING_2 \

| COMP_CFGR1_BLANKING_1)


Comparator output blanking source TIM15 OC2.

LL_COMP_BLANKINGSRC_LPTIM1_OC1

(COMP_CFGR1_BLANKING_2 \

| COMP_CFGR1_BLANKING_1 \

| COMP_CFGR1_BLANKING_0)


Comparator output blanking source LPTIM1 OC1, specific to instance: COMP2.

Comparator output - Output level

group COMP_LL_EC_OUTPUT_LEVEL

Defines

LL_COMP_OUTPUT_LEVEL_LOW (0x00000000UL)

Comparator output level low (with polarity not inverted)

LL_COMP_OUTPUT_LEVEL_HIGH (0x00000001UL)

Comparator output level high (with polarity not inverted)

Definitions of COMP hardware constraints delays

group COMP_LL_EC_HW_DELAYS

Note

Only COMP peripheral HW delays are defined in COMP LL driver driver, not timeout values.

Defines

LL_COMP_DELAY_STARTUP_US (80UL)

Delay for comparator startup time. Delay set to maximum value (refer to device datasheet, parameter “tSTART”). Unit: us. Note: At comparator enable, delay required to reach propagation delay specification.

LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US (220UL)

Delay for comparator voltage scaler stabilization time Delay set to maximum value (refer to device datasheet, parameter “tSTART_SCALER”). Unit: us. Note: Voltage scaler is used when selecting comparator input based on VrefInt (VrefInt or subdivision of VrefInt). Note: To get scaler bridge configuration, refer to LL_COMP_IsInputScalerEnabled().

Comparator common modes - Window mode

Note

This section is not available for STM32C562xx.

Comparator common modes - Window output

Note

This section is not available for STM32C562xx.